<template>
  <div>
      <h5 v-text="msg" ref="title"></h5>
      <button @click="showDOM" ref="btn">点击输出上方DOM元素</button>
      <School ref="sch"/>
  </div>
</template>

<script>
import School from './components/School.vue'
export default {
    name:'Vue',
    components:{
        School
    },
    data() {
        return {
            msg:'vue-cli',
        }
    },
    methods: {
        showDOM(){
            console.log(this.$refs.title) // 真是的DOM
            console.log(this.$refs.btn) // 真是的DOM
            console.log(this.$refs.sch) // School组件的实例对象
        }
    },
}
</script>

<style>

</style>